package com.codeyang.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述: TO-删除标志-DO
 *
 * @author CodeYang_Site
 * @version 2021/5/22 21:44
 */
@Component
@ConfigurationProperties(prefix = "allow-url")
public class URLConfig {

    /**
     * 放行请求的集合
     */
    private static List<String> allowList = new ArrayList<>();

    static {
        allowList.add("/v2/api-docs");
        allowList.add("/v3/api-docs");
        allowList.add("/swagger-resources/configuration/ui");
        allowList.add("/swagger-resources");
        allowList.add("/swagger-resources/configuration/security");
        allowList.add("/webjars/**");
        allowList.add("/swagger-ui/**");
        allowList.add("/druid/**");
        allowList.add("/actuator/**");
    }

    public static String[] getAllowList() {

        String[] toBeStored = new String[allowList.size()];
        return toBeStored;
    }
}
